<%@page import="spring.security.services.SpringBeansProvider"%>
<%@page import="spring.security.entities.GitVersionBean"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Spring Security admin page</title>
		
		<!-- Bootstrap 3.0 CSS -->	   
		<link rel="stylesheet" type="text/css" media="screen" href='<c:url value="/css/bootstrap_cerulean.css"/>'/>
		<!-- JQuery CSS -->
		<link rel="stylesheet" type="text/css" media="screen" href='<c:url value="/css/jquery-ui-1.10.3.css"/>'/>
		<!-- jqGrid CSS -->
		<link rel="stylesheet" type="text/css" media="screen" href='<c:url value="/jqgrid/css/ui.jqgrid.css"/>'/>	
		<!-- Index CSS -->
		<link rel="stylesheet" type="text/css" media="screen" href='<c:url value="/css/stickyFooter.css"/>'/>
		<link rel="stylesheet" type="text/css" media="screen" href='<c:url value="/css/emp-main.css"/>'/>
		
		<%!
			GitVersionBean versionBean = SpringBeansProvider.getBean("gitVersionBean", GitVersionBean.class);
		%> 
	</head>
	<body>
		<div id="wrap">	
			<nav id="nav-bar" class="navbar navbar-inverse" role="navigation" style="border-radius:0px;">
	 			<div class="navbar-header">
					<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse" id="toggleBtn">
						<span class="sr_only"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</button>				
					<a class="navbar-brand" href="#" onclick="serverReload();">USER</a>
				</div> 
				
				<div id="empNavbar" class="collapse navbar-collapse navbar-inverse-collapse" data-parent="#nav-bar">
					<ul class="nav navbar-nav">
						<li><a id="mapEngines"  href="common">Home</a></li>
						<li><a id="wmsConfig" href="admin">Administration</a></li>
						<!-- <li><a id="mapToolConfig" href="#">Map Tools</a></li>
						<li><a id="owfConfig" href="#">Ozone</a></li> -->
						<li class="dropdown">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown">Settings<span class="caret"></span></a>
							<ul class="dropdown-menu">
								<li><a id="proxyConfig" href="../auth/logout">logout</a></li>
								<!-- <li><a id="owfConfig" href="#">OWF-Lib Configuration</a></li> -->
							</ul>
						</li> 
					</ul>
				</div>
			</nav>
		
			
		  	<div class="container">
				<h1>Admin Page</h1>
				<h3>Welcome <%= request.getRemoteUser() %></h3>
				<%-- <h3 th:inline="text">Welcome [[${#httpServletRequest.remoteUser}]]!</h3> --%>
				<p>Only admins have access to this page.</p>
				<p>
					Curabitur quis libero elit, dapibus iaculis nisl. Nullam quis velit eget odio 
					adipiscing tristique non sed ligula. In auctor diam eget nisl condimentum laoreet..
				</p>
				
				<!--
				<div>
					<form th:action="../auth/logout" method="get">
						<input type="submit" value="Sign Out" />
					</form>
				</div>
				
				 <a href="../auth/logout">logout</a>		
				<a href="common">Home</a> -->
			</div>
			
			<div id="push"></div>	
		</div>
	 	<div id="footer-wrap" class="navbar-inverse"> 		
			<div class="layout-wrap" id="footer">            
					<div id="footer-info">				  
						<div id="footer-blocks" class="navbar-inverse"> 
						<div class="col-md-6">
							 <div id="footer-about-block">
									<div class="footer-block-content">
									   <div data-icon="" id="fbi-about" class="footer-block-icon"><span class="glyphicon glyphicon-info-sign"></span></div>						   
									   <div class="ftb-text" style="line-height: 25px;">
											<div class="footer-tiny-title"><%= versionBean.getName() %></div>
											<div class="footerRevInfo">
												<ul class="nav nav-pills nav-stacked">
							        				<li>        			
							        					<span>Branch: <span id="releaseInfo" class="badge footerBadge"><%= versionBean.getRevision().getBranch() %></span></span>
							        				</li>
							        				<li title="info">        			
							        					<span>Revision: </span><span id="gitDescribe" class="badge footerBadge"><%= versionBean.getRevision().getDescribe() %></span>
							        				</li>
							        				<li title="info">        			
							        					<span>Date: </span><span id="gitDate" class="badge footerBadge"><%= versionBean.getRevision().getBuildTime() %></span>
							        				</li>				        				
							        				<li>        			
							        					<span>Version: </span><span id="appVersion" class="badge footerBadge"><%= versionBean.getVersion() %></span>
							        				</li>
							        			</ul>
							        		</div>
										</div> <!-- fb-text -->
									</div>     
							</div> <!-- footer block -->		
						</div>	
						<div class="clearfix visible-xs"></div>	 
					</div>    
				</div>
			</div>	   		
		</div>
	 
   	
		<!-- The overlay and the box -->
<%-- 		<div class="container">
		    <div class="overlay" id="overlay" style="display:none;"></div>
		    <div class="box" id="box">
		        <a class="boxclose" id="boxclose"></a>
		        <h1>ERROR: Severe</h1>
		        <img src="images/error.png" />
		        <h3 style="padding: 10px 0px 17px 25px;color:#EF7777;">Properties file not found</h3>
		        <h4 style="padding: 0px 0px 10px 0px;color:#7F7F7F;">To resolve this issue perform the following steps:</h4>
				<div id="error-content">
					<ul  style="list-style-type: decimal;">
					<li> Download <a style="cursor:pointer;color:#0077cc;" onclick="getPropertyFile('${downloadFileUrl}')">${utils.getApplicationPropertyName()}</a> file</li>
						<li>
							<span>Place ${utils.getApplicationPropertyName()} file in the following location:</span>
						<ul style="list-style-type: disc;padding-left: 20px;"><li><span style="font-size: 12px">${PropertyFileManager.getInstance().getConfigPath()}</span></li></ul>							
						</li> 
						<li>Close the browser and reload the page</li>
					</ul>			
				</div>
		     </div>
	     </div>    --%>
		
		
		<!-- The actual JQuery code -->	
		<script type='text/javascript' src='<c:url value="/js/lib/jquery-1.10.2.min.js"/>'></script> 
		<!-- The JQuery UI code -->		
		<script type='text/javascript' src='<c:url value="/js/lib/jquery-ui-1.10.3.custom.min.js"/>'></script>
		
		<!-- The Bootstrap -->		
		<script type='text/javascript' src='<c:url value="/js/lib/bootstrap.min.js"/>'></script>
	</body>
</html>